<!-- 成员授权编辑页面 -->
<extend name="Public/base" />

<block name="body">
  <div class="tab-wrap">
    <ul class="tab-nav nav">
      <li class="current"><a href="javascript:;">成员授权</a></li>
      <li class="fr">
        <select name="group">
          <volist name="lists_user_group" id="vo">
            <option value="{:U('user',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" <if condition="$vo['id'] eq I('get.group_id')">selected</if> >{$vo.title}</option>
          </volist>
        </select>
      </li>
    </ul>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
      <table class="">
        <thead>
        <tr>
          <th class="">UID</th>
          <th class="">昵称</th>
          <th class="">最后登录时间</th>
          <th class="">最后登录IP</th>
          <th class="">状态</th>
          <th class="">操作</th>
        </tr>
        </thead>
        <tbody>
          <volist name="lists" id="vo">
          <tr>
            <td>{$vo.id} </td>
            <td>{$vo.id|get_nickname}</td>
            <td><span>{$vo.last_login_time|time_format}</span></td>
            <td><span>{$vo.last_login_ip|long2ip}</span></td>
            <td>{$vo.status_text}</td>
            <td>
              <a href="{:U('removeFromGroup?id='.$vo['id'].'&group_id='.I('group_id'))}" class="ajax-get">解除授权</a>
            </td>
          </tr>
          </volist>
        </tbody>
      </table>
    </div>
    <div class="main-title">
      <div class="page_nav fl">
        {$_page}
      </div>
      <div id="add-to-group" class="tools fr">
        <form class="add-user" action="{:U('addToGroup')}" method="post" enctype="application/x-www-form-urlencoded" >
          {:hook('userSel', array('name' => 'users' ,'value' => '','empty_tip' => '请选择用户'))}
          <input type="hidden" class="text input-large J_user_name" name="uids">
          <input type="hidden" name="group_id" value="{:I('get.group_id')}">
          <button type="submit" class="btn ajax-post confirm" target-form="add-user">新增授权</button>
        </form>
      </div>
    </div>
  </div>
</block>

<block name="script">
  <script type="text/javascript" charset="utf-8">
    $('select[name=group]').change(function(){
      location.href = this.value;
    });
    //导航高亮
    highlight_subnav('{:U('UserGroup/index')}');
  </script>
</block>
